"""
FFmpeg decoders.
"""

{% import "_components.jinja" as _components %}

from typing import Literal

{{ _components.import_all(template_path) }}

{% for codec in codecs %}
{% if codec.is_decoder %}
def {{codec.name | option_name_safe }}(
    {% for option in codec.filtered_options() %}
    {{option.name| option_name_safe}}: {{option.code_gen_type}} = None,
    {% endfor %}
) -> FFMpegDecoderOption:
    """
    {{codec.description}}
    {% if codec.options | length > 0 %}
    Args:
    {%- for option in codec.filtered_options() %}
        {{option.name | option_name_safe}}: {{option.help}}
    {%- endfor %}
    {%- endif %}

    Returns:
        the set codec options
    """
    return FFMpegDecoderOption(merge({
        {% for option in codec.filtered_options() %}
        "{{ option.name}}": {{ option.name | option_name_safe }},
        {% endfor %}
    }))
{% endif %}
{% endfor %}
